While
While <.expression.> ... EndWhile
 
Parameters: NONE
Returns: NONE
 

      A While-EndWhile loop executes its constituent groups of statements repeatedly, testing the expression before each iteration. As long as expression returns True, execution continues.



FACTS:


      * While-EndWhile must be paired.

      * The While must preceed the EndWhile statement. You'll get an error otherwise.

      * You can exit a While-EndWhile loop anytime with the Exit or the ExitWhile statement.

      * Not sure about loops ? Make sure you read the Loops Tutorial then





Mini Tutorial:


      A simple While-EndWhile loop

  
; The Main loop
  Do
   ; Draw random dots while the mouse button is pressed
     While MouseButton()
        Dot Rnd(100)+100Rnd(100)+100
        Sync
     EndWhile
     Sync
  Loop
  



 
Related Info: Comparisons | Continue | Do | EndWhile | Exit | ExitWhile | Loops | Repeat :
 


(c) Copyright 2002 - 2024 - Kevin Picone - PlayBASIC.com